- /* sloshftl.cpp by K.Tsuru */
- // function ID = 244 DARDIX
- /***********************
- SLong class
- bit shift operator m<<n
- It mutiplis by 2^n.
- ***********************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SLong operator<<(const SLong& m, ulong n){
- if(!n || (m.Sign(244) == 0)) return m;
-
- double x = (n < 100L) ? pow(2.0, (int)n) : DBL_MAX; // ver.2.17
- if(x < (double)m.SlOpMaxValue()){
- ulong d = 1L << (int)n;
- return LsMult(m, d);
- }
- SLong two(m.Type(), m.MinSize(), 2L);
- SLong result = Lpow(two, n); // 2^n
-
- result *= m;
- return result;
- }
sloshftl.cpp : last modifiled at 2015/11/27 14:26:29(573 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).